package com.auxgroup.smarthome.repo;

import com.auxgroup.smarthome.entity.DeviceInfoEntity;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface DeviceInfoEntityRepo extends GenericDao<DeviceInfoEntity,String> {

    DeviceInfoEntity findByMacAndTrashFalse(String mac);

    DeviceInfoEntity findByDeviceIdAndTrashFalse(String deviceId);

    @Query(value = "select * from device_info where mac = ? or mac = ? " ,nativeQuery = true)
    List<DeviceInfoEntity> findDeviceListByMac(String newMac, String oldMac);

}